#include <string.h> char *strcat(s, append) char *s, *append; char *strncat(s, append, count) char *s, *append; int count; strcmp(s1, s2) char *s1, *s2; strncmp(s1, s2, count) char *s1, *s2; int count; strcasecmp(s1, s2) char *s1, *s2; strncasecmp(s1, s2, count) char *s1, *s2; int count; char *strcpy(to, from) char *to, *from; char *strncpy(to, from, count) char *to, *from; int count; char *strdup(s) char *s; strlen(s) char *s; char *strchr(s, c) char *s; int c; char *index(s, c) char *s, c; char *strrchr(s, c) char *s; int c; char *rindex(s, c) char *s, c; char *strstr(s, s2) char *s, *s2; int strspn(s, s2) char *s, *s2; int strcspn(s, s2) char *s, *s2; char *strpbrk(s, s2) char *s, *s2;
Strcat appends a copy of string append to the end of string s. Strncat copies at most count characters. Both return a pointer to the null-terminated result.
Strcmp compares its arguments and returns an integer greater than, equal to, or less than 0, according as s1 is lexicographically greater than, equal to, or less than s2. Strncmp makes the same comparison but looks at at most count characters. Strcasecmp and strncasecmp are identical in function, but are case insensitive. The returned lexicographic difference reflects a conversion to lower-case.
Strcpy copies string from to to, stopping after the null character has been moved. Strncpy copies exactly count characters, appending nulls if from is less than count characters in length; the target may not be null-terminated if the length of from is count or more. Both return to.
Strdup allocates storage for a copy of s, copies s into it, and returns the copied string. The copy may be freed by calling free(3).
Strlen returns the number of non-null characters in s.
Strchr and index both return pointers to the first occurrence of character c in string s or NULL if c does not occur in the string. The two procedures are identical except for their names and the argument c, which is an int in strchr and a char in index. With the ANSI C standard, index is becoming obsolete.
Strrchr and rindex are identical to strchr and index except that the return the address of the last occurrence of c instead of the first. Rindex is also becoming obsolete.
Strstr locates the first occurrence in the string pointed to by s of the sequence of characters (not including the terminating null character) in the string pointed to by s2. If a match is found, the return value is the address of the first character in the matching substring. Otherwise, NULL is returned. If s2 points to a string with zero length, then s is returned.
Strspn returns the length of the longest initial segment of s that consists entirely of characters from the string pointed to by s2. Strcspn returns the length of the longest initial segment of s that consists entirely of characters not in the string pointed to by s2.
Strpbrk returns the address of the first character in the string pointed to by s of any character in the string pointed to by s2. If no character from s2 occurs in s1, then NULL is returned.